package com.acme.bankapp.client.validator;

public class IPAdressValidator implements Validator<String> {

    private static final String IP_ADRESS_PATTERN = "^([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\."
	    + "([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\."
	    + "([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\."
	    + "([01]?\\d\\d?|2[0-4]\\d|25[0-5])$";
    
    @Override
    public boolean validate(String ip) {
	if(ip.matches(IP_ADRESS_PATTERN)) {
	    return true;
	}
	return false;
    }
}
